home *** CD-ROM | disk | FTP | other *** search
Wrap
sssshhhhmmmmoooopppp((((2222)))) sssshhhhmmmmoooopppp((((2222)))) NNNNAAAAMMMMEEEE _ssss_hhhh_mmmm_oooo_pppp: _ssss_hhhh_mmmm_aaaa_tttt, _ssss_hhhh_mmmm_dddd_tttt - shared memory operations CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>> _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_iiii_pppp_cccc_...._hhhh_>>>> _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_ssss_hhhh_mmmm_...._hhhh_>>>> _vvvv_oooo_iiii_dddd _****_ssss_hhhh_mmmm_aaaa_tttt_((((_iiii_nnnn_tttt _ssss_hhhh_mmmm_iiii_dddd_,,,, _vvvv_oooo_iiii_dddd _****_ssss_hhhh_mmmm_aaaa_dddd_dddd_rrrr_,,,, _iiii_nnnn_tttt _ssss_hhhh_mmmm_ffff_llll_gggg_))))_;;;; _iiii_nnnn_tttt _ssss_hhhh_mmmm_dddd_tttt _((((_vvvv_oooo_iiii_dddd _****_ssss_hhhh_mmmm_aaaa_dddd_dddd_rrrr_))))_;;;; DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN _ssss_hhhh_mmmm_aaaa_tttt attaches the shared memory segment associated with the shared memory identifier specified by _s_h_m_i_d to the data segment of the calling process. The segment is attached at the address specified by one of the following criteria: If _s_h_m_a_d_d_r is equal to _((((_vvvv_oooo_iiii_dddd _****_)))) _0000, the segment is attached at the first available address as selected by the system. If (_s_h_m_f_l_g_&&&&_SSSS_HHHH_MMMM______SSSS_GGGG_IIII______AAAA_NNNN_YYYY_AAAA_DDDD_DDDD_RRRR) is true, the segment is attached at the first available address, otherwise the system selects an available address that is outside of the reserved area between 0x30000000 and 0x40000000. See _mmmm_mmmm_aaaa_pppp(2) and _ssss_gggg_iiii______uuuu_ssss_eeee______aaaa_nnnn_yyyy_aaaa_dddd_dddd_rrrr(1) for more information on the reserved range. If _s_h_m_a_d_d_r is not equal to _((((_vvvv_oooo_iiii_dddd _****_)))) _0000 and (_s_h_m_f_l_g_&&&&_SSSS_HHHH_MMMM______RRRR_NNNN_DDDD) is true, the segment is attached at the address given by (_s_h_m_a_d_d_r _---- (_s_h_m_a_d_d_r modulus _SSSS_HHHH_MMMM_LLLL_BBBB_AAAA)). If _s_h_m_a_d_d_r is not equal to _((((_vvvv_oooo_iiii_dddd _****_)))) _0000 and (_s_h_m_f_l_g_&&&&_SSSS_HHHH_MMMM______RRRR_NNNN_DDDD) is false, the segment is attached at the address given by _s_h_m_a_d_d_r. The actual argument corresponding to shmaddr is evaluated by setting an INTEGER*4 variable to the location of the process's data segment, in other words, the value returned by _%%%%_llll_oooo_cccc(3F). Under certain conditions, performance can be greatly improved by sharing mapping resources among processes attached to the same SHM segment. In order to achieve sharing of mapping resources, the following conditions must hold: - the size of the SHM segment is a multiple of the constant _SSSS_HHHH_MMMM_SSSS_UUUU_SSSS (SHM Segment Unit Size). - the attaching address sssshhhhmmmmaaaaddddddddrrrr is a multiple of _SSSS_HHHH_MMMM_SSSS_UUUU_SSSS. - (_s_h_m_f_l_g_&&&&_SSSS_HHHH_MMMM______RRRR_DDDD_OOOO_NNNN_LLLL_YYYY) is false The caller authorizes the system to use shared mapping resources by setting the flag _SSSS_HHHH_MMMM______SSSS_HHHH_AAAA_TTTT_TTTT_RRRR in _s_h_m_f_l_g. PPPPaaaaggggeeee 1111 sssshhhhmmmmoooopppp((((2222)))) sssshhhhmmmmoooopppp((((2222)))) If (_s_h_m_f_l_g_&&&&_SSSS_HHHH_MMMM______SSSS_HHHH_AAAA_TTTT_TTTT_RRRR) is true and the above conditions are met the system uses shared mapping resources. If (_s_h_m_f_l_g_&&&&_SSSS_HHHH_MMMM______SSSS_HHHH_AAAA_TTTT_TTTT_RRRR) is true and any of the above conditions are false the system call fails. Use of the _SSSS_HHHH_MMMM______SSSS_HHHH_AAAA_TTTT_TTTT_RRRR flag is discouraged in the following situations: - if the calling process is likely to unmap (_m_u_n_m_a_p(2)) or to re-map (_m_m_a_p(2)) large portions of the SHM segment, or - if the calling process is likely to change the mapping attributes (access permissions and cache policies) on large portions of the SHM segment (_m_p_r_o_t_e_c_t(2)). These behaviors cause the system to make private copies of mapping resources and stop sharing, thereby defeating the purpose of the _SSSS_HHHH_MMMM______SSSS_HHHH_AAAA_TTTT_TTTT_RRRR capability. _ssss_hhhh_mmmm_dddd_tttt detaches from the calling process's data segment the shared memory segment located at the address specified by _s_h_m_a_d_d_r. The segment is attached for reading if (_s_h_m_f_l_g_&&&&_SSSS_HHHH_MMMM______RRRR_DDDD_OOOO_NNNN_LLLL_YYYY) is true - {READ}, otherwise it is attached for reading and writing {READ/WRITE}. _ssss_hhhh_mmmm_aaaa_tttt fails and does not attach the shared memory segment if one or more of the following are true: _EEEE_IIII_NNNN_VVVV_AAAA_LLLL _s_h_m_i_d is not a valid shared memory identifier. _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS Operation permission is denied to the calling process [see _iiii_nnnn_tttt_rrrr_oooo(2)]. _EEEE_NNNN_OOOO_MMMM_EEEE_MMMM The available data space is not large enough to accommodate the shared memory segment. _EEEE_IIII_NNNN_VVVV_AAAA_LLLL _s_h_m_a_d_d_r is not equal to zero, and the value of (_s_h_m_a_d_d_r _---- (_s_h_m_a_d_d_r modulus _SSSS_HHHH_MMMM_LLLL_BBBB_AAAA)) is an illegal address. _EEEE_IIII_NNNN_VVVV_AAAA_LLLL _s_h_m_a_d_d_r is not equal to zero, (_s_h_m_f_l_g_&&&&_SSSS_HHHH_MMMM______RRRR_NNNN_DDDD) is false, and the value of _s_h_m_a_d_d_r is an illegal address. _EEEE_MMMM_FFFF_IIII_LLLL_EEEE The number of shared memory segments attached to the calling process would exceed the system-imposed limit. _EEEE_IIII_NNNN_VVVV_AAAA_LLLL _s_h_m_a_d_d_r is not a multiple of SHMSUS and (_s_h_m_f_l_g_&&&&_SSSS_HHHH_MMMM______SSSS_HHHH_AAAA_TTTT_TTTT_RRRR) is true, or the size of the SHM segment is not a multiple of SHMSUS and (_s_h_m_f_l_g_&&&&_SSSS_HHHH_MMMM______SSSS_HHHH_AAAA_TTTT_TTTT_RRRR) is true. PPPPaaaaggggeeee 2222 sssshhhhmmmmoooopppp((((2222)))) sssshhhhmmmmoooopppp((((2222)))) _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS (_s_h_m_f_l_g_&&&&_SSSS_HHHH_MMMM______SSSS_HHHH_AAAA_TTTT_TTTT_RRRR) is true and (_s_h_m_f_l_g_&&&&_SSSS_HHHH_MMMM______RRRR_DDDD_OOOO_NNNN_LLLL_YYYY) is true. _EEEE_IIII_NNNN_VVVV_AAAA_LLLL _ssss_hhhh_mmmm_dddd_tttt fails and does not detach the shared memory segment if _s_h_m_a_d_d_r is not the data segment start address of a shared memory segment. SSSSEEEEEEEE AAAALLLLSSSSOOOO sgi_use_anyaddr(1), exec(2), exit(2), fork(2), intro(2), shmctl(2), shmget(2), sproc(2). DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS Upon successful completion, the return value is as follows: _ssss_hhhh_mmmm_aaaa_tttt returns the data segment start address of the attached shared memory segment. _ssss_hhhh_mmmm_dddd_tttt returns a value of 0. Otherwise, a value of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to indicate the error. NNNNOOOOTTTTEEEESSSS The user must explicitly remove shared memory segments after the last reference to them has been removed. PPPPaaaaggggeeee 3333